package objects;

public class User{
	
	protected String name;
	protected String email;
	protected String role;
	protected String id;
	
	
	public String getName() {
		return name;
	}
	
	public String getId() {
		return id;
	}
	
	public User setId(String id) { 
		this.id = id;
		return this;
	}
	
	public String getEmail() {
		return email;
	}
	

	public User setEmail(String email) { 
		this.email = email;
		return this;
	}
		
	public User setName(String name) {
		this.name = name;
		return this;
	}
	
	public User setRole(String role) {
		this.role = role;
		return this;
	}
	
	public String getRole() {
		return role;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((role == null) ? 0 : role.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (role == null) {
			if (other.role != null)
				return false;
		} else if (!role.equals(other.role))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "User [name=" + name + ", email=" + email + ", role=" + role
				+ "]";
	}

	
	
}
